//
//  WmcCloudSearchPhotoCell.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/3/31.
//

import UIKit

class WmcCloudSearchPhotoCell: WmcBaseTableCell {
    // Internal

    override func makeUI() {
        titleLabel.textColor = .wmc_grayH2_323233
        titleLabel.font = 17.wmc_font
        addSubview(titleLabel)
        titleLabel.snp.makeConstraints { make in
            make.top.bottom.equalToSuperview()
            make.left.equalTo(Wmc_standardEdge.left)
            make.width.equalTo(70)
        }

        addSubview(arrowImageView)
        arrowImageView.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.right.equalTo(-Wmc_standardEdge.right)
            make.size.equalTo(12)
        }

        addSubview(disTitleLabel)
        disTitleLabel.snp.makeConstraints { make in
            make.top.bottom.equalToSuperview()
            make.right.equalTo(arrowImageView.snp.left).offset(-8)
            make.left.equalTo(titleLabel.snp.right).offset(20)
        }

        addSubview(lineView)
        lineView.snp.makeConstraints { make in
            make.left.equalTo(Wmc_standardEdge.left)
            make.bottom.equalToSuperview()
            make.right.equalTo(-Wmc_standardEdge.right)
            make.height.equalTo(0.5)
        }
    }

    func configModel(_ model: WmcCloudSearchPhotoVM.CellModel) {
        titleLabel.text = model.title
        disTitleLabel.text = model.disTitle
        disTitleLabel.textColor = model.disTitleColor
    }
    // Private

    private lazy var disTitleLabel: UILabel = {
        let label = UILabel.YP.Create(
            font: 17,
            color: UIColor.white,
            alignment: .right)
        return label
    }()
}

/// 扩展适应新模型

extension WmcCloudSearchPhotoCell {
    
    func configModel(_ model: WmcTeamSearchVM.CellModel) {
        titleLabel.text = model.title
        disTitleLabel.text = model.disTitle
        disTitleLabel.textColor = model.disTitleColor
    }
}
